package cn.dakaqi.services.user.impl;

import cn.dakaqi.dao.user.UserOpenIdDao;
import cn.dakaqi.entities.user.UserOpenId;
import cn.dakaqi.services.user.UserOpenService;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author beliveli at 16/08/12
 */
@Component(value = "userOpenService")
@Transactional
public class UserOpenServiceImpl implements UserOpenService {

    @Resource
    private UserOpenIdDao userOpenIdDao;

    @Override
    public UserOpenId findByOpenId(String openId, int type) {
        return userOpenIdDao.findByOpenIdAndType(openId, type);
    }

    public UserOpenId save(UserOpenId userOpenId) {
        return userOpenIdDao.save(userOpenId);
    }
}
